package com.zhentao.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 检测报告表
 * @TableName inspection_report
 */
@TableName(value ="inspection_report")
@Data
public class InspectionReport implements Serializable {
    /**
     * 报告ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 任务ID
     */
    private Long taskId;

    /**
     * 报告编号
     */
    private String reportNo;

    /**
     * 报告类型(STANDARD:标准报告,DETAILED:详细报告,SUMMARY:摘要报告)
     */
    private String reportType;

    /**
     * 总图片数
     */
    private Integer totalImages;

    /**
     * 总检测数
     */
    private Integer totalDetections;

    /**
     * 总缺陷数
     */
    private Integer totalDefects;

    /**
     * 综合评分(0-100)
     */
    private BigDecimal overallScore;

    /**
     * 综合状态(EXCELLENT:优秀,GOOD:良好,NORMAL:正常,POOR:较差,CRITICAL:严重)
     */
    private String overallStatus;

    /**
     * 报告内容(JSON格式)
     */
    private String reportContent;

    /**
     * 报告文件路径
     */
    private String reportFilePath;

    /**
     * 报告文件URL
     */
    private String reportFileUrl;

    /**
     * 生成时间
     */
    private Date generateTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        InspectionReport other = (InspectionReport) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getReportNo() == null ? other.getReportNo() == null : this.getReportNo().equals(other.getReportNo()))
            && (this.getReportType() == null ? other.getReportType() == null : this.getReportType().equals(other.getReportType()))
            && (this.getTotalImages() == null ? other.getTotalImages() == null : this.getTotalImages().equals(other.getTotalImages()))
            && (this.getTotalDetections() == null ? other.getTotalDetections() == null : this.getTotalDetections().equals(other.getTotalDetections()))
            && (this.getTotalDefects() == null ? other.getTotalDefects() == null : this.getTotalDefects().equals(other.getTotalDefects()))
            && (this.getOverallScore() == null ? other.getOverallScore() == null : this.getOverallScore().equals(other.getOverallScore()))
            && (this.getOverallStatus() == null ? other.getOverallStatus() == null : this.getOverallStatus().equals(other.getOverallStatus()))
            && (this.getReportContent() == null ? other.getReportContent() == null : this.getReportContent().equals(other.getReportContent()))
            && (this.getReportFilePath() == null ? other.getReportFilePath() == null : this.getReportFilePath().equals(other.getReportFilePath()))
            && (this.getReportFileUrl() == null ? other.getReportFileUrl() == null : this.getReportFileUrl().equals(other.getReportFileUrl()))
            && (this.getGenerateTime() == null ? other.getGenerateTime() == null : this.getGenerateTime().equals(other.getGenerateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getReportNo() == null) ? 0 : getReportNo().hashCode());
        result = prime * result + ((getReportType() == null) ? 0 : getReportType().hashCode());
        result = prime * result + ((getTotalImages() == null) ? 0 : getTotalImages().hashCode());
        result = prime * result + ((getTotalDetections() == null) ? 0 : getTotalDetections().hashCode());
        result = prime * result + ((getTotalDefects() == null) ? 0 : getTotalDefects().hashCode());
        result = prime * result + ((getOverallScore() == null) ? 0 : getOverallScore().hashCode());
        result = prime * result + ((getOverallStatus() == null) ? 0 : getOverallStatus().hashCode());
        result = prime * result + ((getReportContent() == null) ? 0 : getReportContent().hashCode());
        result = prime * result + ((getReportFilePath() == null) ? 0 : getReportFilePath().hashCode());
        result = prime * result + ((getReportFileUrl() == null) ? 0 : getReportFileUrl().hashCode());
        result = prime * result + ((getGenerateTime() == null) ? 0 : getGenerateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", taskId=").append(taskId);
        sb.append(", reportNo=").append(reportNo);
        sb.append(", reportType=").append(reportType);
        sb.append(", totalImages=").append(totalImages);
        sb.append(", totalDetections=").append(totalDetections);
        sb.append(", totalDefects=").append(totalDefects);
        sb.append(", overallScore=").append(overallScore);
        sb.append(", overallStatus=").append(overallStatus);
        sb.append(", reportContent=").append(reportContent);
        sb.append(", reportFilePath=").append(reportFilePath);
        sb.append(", reportFileUrl=").append(reportFileUrl);
        sb.append(", generateTime=").append(generateTime);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}